import instance from '@/api/axios'
export const zc = (username, password) => {
    return instance({
        method: 'post',
        url: 'http://localhost:12345/api/user/register',
        data: {
            username, password
        }
    });
}

export const dl = (username, password) => {
    return instance({
        method: 'post',
        url: 'http://localhost:12345/api/user/login',
        data: {
            username, password
        }
    });
}

export const lbt = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
    });
}

export const dh = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
    });
}

export const lc = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/floordata',
    });
}

export const fl = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/categories',
    });
}

export const lb = (data) => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/search',
        params: {
            ...data
        }
    });
}

export const xq = (goods_id) => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/detail',
        params: {
            goods_id
        }
    });
}

export const ss = (query) => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/qsearch',
        params: {
            query
        }
    });
}
